package com.yuqiao.read.design.templatefun;

public abstract class CaffeineBeverage {

    final void prepareRecipe() {
        boilWater();
        brew();
        pourInCup();
        if (hook()) {
            addCondiments();
        }
    }

    Boolean hook() {
        return true;
    }


    abstract void brew();

    abstract void addCondiments();

    public void boilWater() {
        System.out.println("烧水");
    }

    public void pourInCup() {
        System.out.println("倒入杯子");
    }
}
